<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateExchangeRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('exchange_record', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("user_id")->comment("用户ID");
            $table->decimal("money",10,2)->default(0)->comment("兑换金额");
            $table->integer("coupon_id")->comment("优惠券ID");
            $table->string("other_goods",100)->nullable()->comment("实物奖品");
            $table->string("username",50)->nullable()->comment("收货人");
            $table->string("phone",20)->nullable()->comment("联系电话");
            $table->string("address",150)->nullable()->comment("收货地址");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('exchange_record');
    }
}
